﻿using System.Web.Mvc;

namespace Controllers.Areas.Department
{
    public class DepartmentAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Department";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            //Area的路由和全局的路由是区分开的
            context.MapRoute(
                this.AreaName+"_default",
                this.AreaName+"/{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new string[] { "Controllers.Areas."+this.AreaName+".Controllers" }//指定寻找的命名空间
            );
        }
    }
}
